Skip to content

[codex] Enforce Effect error handling conventions#3380

Merged
juliusmarminge merged 5 commits into
mainfrom
codex/effect-error-review-rules
Jun 21, 2026
Merged

[codex] Enforce Effect error handling conventions#3380
juliusmarminge merged 5 commits into
mainfrom
codex/effect-error-review-rules

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • require Effect.catchTags for statically known tagged failures while preserving exhaustive and structural catch exceptions
  • reject constructor-only error aliases that hide structured attributes and causes
  • guide reusable error-to-error translations toward descriptive static factories on the target error class

Validation

  • pnpm vp check
  • pnpm vp run typecheck

Note

Low Risk
Documentation-only change to a CI check agent; no runtime or production code paths are modified.

Overview
Extends the Effect service conventions Macroscope agent (.macroscope/check-run-agents/effect-service-conventions.md) with new rules for errors and recovery, without changing application code.

Error safety and translation: Error fields and log annotations must stay bounded—no raw payloads, credentials, or serialized causes in detail/message; real failures stay on cause. At translation boundaries, structured domain errors on the target channel should pass through; only unknown failures get wrapped, optionally via static factories on the target error class.

Catch and construction: Known tagged failures should use Effect.catchTags (not catchTag or tag-only catchIf). Trivial constructor-only error helpers are disallowed; build errors at the failure site unless a mapper does real normalization.

Reporting: The check defaults to failure; a clean run must output exactly All clear on one line with no extra commentary.

Reviewed by Cursor Bugbot for commit eccaf21. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Enforce Effect error handling conventions in the codex agent check

Expands effect-service-conventions.md with five new directives covering error attribute safety, translation boundary behavior, tag-based recovery patterns, construction-site discipline, and static factory usage.

  • Error attributes and log annotations must avoid raw payloads or credentials; legacy detail/serialized cause fields are disallowed
  • At translation boundaries, already-structured domain errors pass through as-is; only unknown or lower-level failures get wrapped
  • Effect.catchTags is preferred for statically known tagged failures; catchIf for tag-based recovery and catchTag are discouraged
  • Helpers that only construct an error are prohibited; errors must be constructed at the failure boundary
  • Static factories on error classes are preferred for reusable error-to-error translations
  • Updates the Reporting section: the check now defaults to failure, and a finding-free run must output exactly All clear on a single line

Macroscope summarized eccaf21.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0f1d0a2d-ffbb-483e-ac09-8865e93940a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/effect-error-review-rules

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR modifies Macroscope configuration files (.macroscope/check-run-agents/effect-service-conventions.md), which control automated review behavior. Changes to these files require human review to verify the intended enforcement rules.

No code changes detected at eccaf21. Prior analysis still applies.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-error-review-rules branch 2 times, most recently from b7c64f6 to cce6723 Compare June 20, 2026 22:50

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Opus model downgraded silently
    • Restored the model from claude-opus-4-7 back to claude-opus-4-8, matching what main uses, since the downgrade was an incorrect assumption by a Codex agent that the model wasn't supported.

Create PR

Or push these changes by commenting:

@cursor push 640dafc23e
Preview (640dafc23e)
diff --git a/.macroscope/check-run-agents/effect-service-conventions.md b/.macroscope/check-run-agents/effect-service-conventions.md
--- a/.macroscope/check-run-agents/effect-service-conventions.md
+++ b/.macroscope/check-run-agents/effect-service-conventions.md
@@ -1,6 +1,6 @@
 ---
 title: Effect Service Conventions
-model: claude-opus-4-7
+model: claude-opus-4-8
 effort: high
 input: full_diff
 tools:

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit cce6723. Configure here.

Comment thread .macroscope/check-run-agents/effect-service-conventions.md Outdated
@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-error-review-rules branch 12 times, most recently from e7012d4 to 205d841 Compare June 21, 2026 02:06
juliusmarminge and others added 5 commits June 20, 2026 19:21
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/effect-error-review-rules branch from 205d841 to eccaf21 Compare June 21, 2026 02:22
@juliusmarminge juliusmarminge merged commit 61f8d46 into main Jun 21, 2026
15 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-error-review-rules branch June 21, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant